# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Samuel Littley <aur@toastwaffle.com>
# Contributor: rnons <remotenonsense at gmail dot com>

_pkg=ruamel.yaml
pkgname=python-${_pkg/./-}
pkgver=0.17.40
pkgrel=1
pkgdesc="YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order"
arch=('any')
url="https://sourceforge.net/projects/ruamel-yaml/"
license=('MIT')
depends=('python-ruamel.yaml.clib')
makedepends=('python-setuptools')
source=(https://files.pythonhosted.org/packages/source/r/${_pkg}/${_pkg}-${pkgver}.tar.gz)
sha512sums=('47ec3508e86d53f7b53dc999dfafc05bb656d3dd02bd289ee97267a6cae5e33e87da584a100e8de44a6d43096d05c13240def8ab9c7010e9efd69d64753004f9')

build() {
  cd ${_pkg}-${pkgver}
  python setup.py build
}

package() {
  cd ${_pkg}-${pkgver}
  # https://bitbucket.org/ruamel/yaml/issues/114/setuppy-requirement-for-pip-prevents
  RUAMEL_NO_PIP_INSTALL_CHECK=1 python setup.py install --skip-build --root="${pkgdir}" --optimize=1
  install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}/
}
